package com.skyline.jfs.storage.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.skyline.jfs.storage.model.JFSAbsoluteStorage;

public class JFSAbsoluteStorageMapper implements RowMapper<JFSAbsoluteStorage> {
	
	private static JFSAbsoluteStorageMapper mapper = new JFSAbsoluteStorageMapper();

	public static JFSAbsoluteStorageMapper getMapper() {
		return mapper;
	}

	@Override
	public JFSAbsoluteStorage mapRow(ResultSet rs, int rowNum) throws SQLException {
		JFSAbsoluteStorage s=new JFSAbsoluteStorage();
		s.setFileId(rs.getLong("fileId"));
		s.setId(rs.getLong("id"));
		s.setJfsNodeId(rs.getInt("jfsNodeId"));
		s.setStorageDirectory(rs.getString("storageDirctory"));
		s.setAbsFileId(rs.getLong("absFileId"));
		s.setAbsoluteFilePath();
		return s;
	}
}
